#pragma once
#include "Thread.h"

#include <memory>
#include <vector>
#include "TaskQueue.h"
#include "Task.h"
using std::unique_ptr;
using std::vector;
class Threadpool
{
public:
    Threadpool(int threadNum, int queSize);
    ~Threadpool();
    void start();
    void stop();
    void addTask(Task *);
    void doTask();

private:
    vector<unique_ptr<Thread>> _threads;
    int _threadNum;
    TaskQueue _que;
    int _queSize;
    bool _isExit;
    

};

